/**
 * Enum of common events
 *
 * @author Kyle
 */
public enum EventType {
    // Enum types
    ARMED_EVENT_ON(21, "A1", "Security System: Armed"),
    ARMED_EVENT_OFF(21, "A0", "Security System: Disarmed"),
    MOTION_ALARM_ON(11, "M1", "Motion Alarm: On"),
    DOOR_ALARM_ON(11, "D1", "Door Alarm: On"),
    WINDOW_ALARM_ON(11, "W1", "Window Alarm: On"),
    MOTION_SECURITY_EVENT(10, "M", null),
    DOOR_SECURITY_EVENT(10, "D", null),
    WINDOW_SECURITY_EVENT(10, "W", null),
    FIRE_ALARM_ON(13, "1", "Fire Alarm: On"),
    FIRE_ALARM_OFF(13, "0", "Fire Alarm: Off"),
    FIRE_EVENT_ON(12, "1", null),
    FIRE_EVENT_OFF(12, "0", null),
    SPRINKLER_ON(14, "1", "Sprinkler System: On"),
    SPRINKLER_OFF(14, "0", "Sprinkler System: Off"),
    CONSOLE_MESSAGE(98, null, null),
    TERMINATE(99, null, null);

    // Enum definition
    private int eventId;
    private String eventMessage;
    private String indicatorMessage;
    EventType(int eventId, String eventMessage, String indicatorMessage) {
        this.eventId = eventId;
        this.eventMessage = eventMessage;
        this.indicatorMessage = indicatorMessage;
    }
    public int getEventId() {
        return eventId;
    }
    public boolean isEvent(int eventId, String eventMessage) {
        return (eventId == this.eventId && (this.eventMessage == null || eventMessage.equals(this.eventMessage)));
    }
    public String getEventMessage() {
        return eventMessage;
    }
    public String getIndicatorMessage() {
        return indicatorMessage;
    }
}
